#pragma once
#ifndef __EXCUTOR_POOL_H__
#define __EXCUTOR_POOL_H__

#include <vector>
#include <thread>

#include "Excutor.h"
#include "IEvent.h"
#include "IActor.h"

namespace NTrader
{
class ExcutorPool
{
public:

	typedef std::shared_ptr<IEvent> Event_t;
	typedef std::shared_ptr<IActor> Actor_t;

	ExcutorPool() = default;
	~ExcutorPool() = default;

	void Start();
	void Stop();

	void Dispatch(Actor_t a, Event_t e);

private:
	typedef std::shared_ptr<Excutor> Excutor_t;
	typedef std::vector<Excutor_t> ThreadPool;

	ThreadPool __pool;

	uint64_t _index = 0;
};

}

#endif

